/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.upc.embajada.ws.sunarp;

/**
 *
 * @author u02728
 */
import org.springframework.web.client.RestTemplate;

public class SunarpServiceImpl implements SunarpService {

    private RestTemplate restTemplate;

    public SunarpServiceImpl() {
        restTemplate = new RestTemplate();
    }

    public SunarpMsg getInfoSunarp(String placa) {

        SunarpMsg dataSunarp = null;

        try {
            dataSunarp = restTemplate.getForObject("http://localhost:8080/WS-Sunarp/webresources/placa/{id}", SunarpMsg.class, placa);
        }
        catch(Exception ex) {
            // System.out.println(ex.getMessage());
        }

        return dataSunarp;
    }
}